<template>
  <!-- <el-tooltip :content="tooltip" :show-after="350" :disabled="!enableTooltip || readonly" effect="dark"
    popper-class="tooltip-up" placement="top" :enterable="false">
    <div class="el-tiptap-editor__super-command-button">
      <el-button color="#02BF66">原文</el-button>
    </div>
  </el-tooltip> -->
  <div class="yuanwen">
    <el-button color="#222222" @click="showChat">对话</el-button>
  </div>
  
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { ElTooltip } from 'element-plus';
import { noop } from '@/utils/shared';
import VIcon from '../Icon/Icon.vue';
import { inject } from 'vue';

export default defineComponent({
  components: {
    ElTooltip,
    VIcon,
  },
  props: {
    icon: {
      type: String,
      required: true,
    },

    disabled: {
      type: Boolean,
      default: false,
    },

    isActive: {
      type: Boolean,
      default: false,
    },

    tooltip: {
      type: String,
      required: true,
    },

    enableTooltip: {
      type: Boolean,
      required: true,
    },

    command: {
      type: Function,
      default: noop,
    },
    buttonIcon: {
      type: String,
      required: false,
      default: ''
    },
    readonly: {
      type: Boolean,
      default: false,
    },
  },
  setup(){
    const showChat = inject('setLayout');
    return {showChat}
  },
  computed: {
    commandButtonClass(): object {
      return {
        'el-tiptap-editor__command-button': true,
        'el-tiptap-editor__command-button--active': this.isActive,
        'el-tiptap-editor__command-button--readonly': (this.readonly || this.disabled),
      };
    },
  },

  methods: {
    onClick() {
      
      // this.showChat();
      // if (!this.readonly && !this.disabled) this.command();
      // console.log('-----------');
      
    },
  },
});
</script>

<style  scoped>
.yuanwen {
  height: 40px;
  line-height: 40px;
  padding: 0 5px;
}
</style>
